package jicheng;
//子类的所有构造方法都会默认访问父类中空参数的构造方法

class Father {
    public Father() {
        System.out.println("father的无参构造方法");
    }
    public Father(String name){
        System.out.println("father的带参构造方法");
    }
}

class Son extends Father{
    public Son() {
        System.out.println("Son的无参构造方法");
    }
    public Son(String name){
        System.out.println("fSon的带参构造方法");
    }

}

public class extendsDemo03 {
    public static void main(String[] args) {
        Son S = new Son();
        System.out.println("------");
        Son s1 = new Son("张三");
    }
}
